package importExport;

import processing.core.PGraphics;

/* -*- mode: java; c-basic-offset: 2; indent-tabs-mode: nil -*- */

/*
 * RawDXF - Code to write DXF files with beginRaw/endRaw
 * An extension for the Processing project - http://processing.org
 * <p/>
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 * <p/>
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 * <p/>
 * You should have received a copy of the GNU Lesser General
 * Public License along with the Processing project; if not,
 * write to the Free Software Foundation, Inc., 59 Temple Place,
 * Suite 330, Boston, MA  02111-1307  USA
 */



import java.io.*;
import java.util.List;

import processing.core.*;
import simpleGeom.HasPos2D;
import simpleGeom.HasPos3D;


/**
 * A simple library to write DXF files with Processing.
 * Because this is used with beginRaw() and endRaw(), only individual 
 * triangles and (discontinuous) line segments will be written to the file. 
 * <P/>
 * Use something like a keyPressed() in PApplet to trigger it,
 * to avoid writing a bazillion .dxf files.
 * <P/>
 * Usually, the file will be saved to the sketch's folder.
 * Use Sketch &rarr; Show Sketch Folder to see it from the PDE.
 * <p/>
 * A simple example of how to use:
 * <PRE>
 * import processing.dxf.*;
 *
 * boolean record;
 *
 * void setup() {
 *   size(500, 500, P3D);
 * }
 *
 * void keyPressed() {
 *   // use a key press so that it doesn't make a million files
 *   if (key == 'r') record = true;
 * }
 *
 * void draw() {
 *   if (record) {
 *     beginRaw(DXF, "output.dxf");
 *   }
 *
 *   // do all your drawing here
 *
 *   if (record) {
 *     endRaw();
 *     record = false;
 *   }
 * }
 * </PRE>
 * or to use it and be able to control the current layer:
 * <PRE>
 * import processing.dxf.*;
 *
 * boolean record;
 * RawDXF dxf;
 *
 * void setup() {
 *   size(500, 500, P3D);
 * }
 *
 * void keyPressed() {
 *   // use a key press so that it doesn't make a million files
 *   if (key == 'r') record = true;
 * }
 *
 * void draw() {
 *   if (record) {
 *     dxf = (RawDXF) createGraphics(width, height, DXF, "output.dxf");
 *     beginRaw(dxf);
 *   }
 *
 *   // do all your drawing here, and to set the layer, call:
 *   // if (record) {
 *   //   dxf.setLayer(num);
 *   // }
 *   // where 'num' is an integer.
 *   // the default is zero, or you can set it to whatever.
 *
 *   if (record) {
 *     endRaw();
 *     record = false;
 *     dxf = null;
 *   }
 * }
 * </PRE>
 * Note that even though this class is a subclass of PGraphics, it only
 * implements the parts of the API that are necessary for beginRaw/endRaw.
 * <P/>
 * Based on the original DXF writer from Simon Greenwold, February 2004.
 * Updated for Processing 0070 by Ben Fry in September 2004,
 * and again for Processing beta in April 2005.
 * Rewritten to support beginRaw/endRaw by Ben Fry in February 2006.
 * Updated again for inclusion as a core library in March 2006.
 * Constructor modifications in September 2008 as we approach 1.0.
 */
public class RawDXFPoly extends PGraphics {

  File file;
  PrintWriter writer;
  int currentLayer;
  String[] header;

  public RawDXFPoly() {
	
  }
  
  public RawDXFPoly(PApplet pApplet) {
	  header=pApplet.loadStrings("/Users/administrator/Documents/workspace/FrameWork120402/bin/pobj/headerDXF.txt");
}
  public void setPath(String path) {
    this.path = path;
    if (path != null) {
      file = new File(path);
      if (!file.isAbsolute()) file = null;
    }
    if (file == null) {
      throw new RuntimeException("PGraphicsPDF requires an absolute path " +
                                 "for the location of the output file.");
    }
  }


  // ..............................................................


  protected void allocate() {
    /*
    for (int i = 0; i < MAX_TRI_LAYERS; i++) {
      layerList[i] = NO_LAYER;
    }
    */
    setLayer(0);
  }


  public void dispose() {
    writeFooter();

    writer.flush();
    writer.close();
    writer = null;
  }


  public boolean displayable() {
    return false;  // just in case someone wants to use this on its own
  }


  // ..............................................................


  public void beginDraw() {
    // have to create file object here, because the name isn't yet
    // available in allocate()
    if (writer == null) {
      try {
        writer = new PrintWriter(new FileWriter(file));
      } catch (IOException e) {
        throw new RuntimeException(e);  // java 1.4+
      }
      writeHeader();
    }
  }


  public void endDraw() {
    // nothing done here
  }


  // ..............................................................


  /**
   * Set the current layer being used in the DXF file.
   * The default is zero.
   */
  public void setLayer(int layer) {
    currentLayer = layer;
  }


  // ..............................................................

  private void writeHeader() {
	 /*for (int i=0;i<header.length;i++){
		 writer.println(header[i]);
	 }*/
	   /* writer.println("0");
	    write("2","HEADER");
	    write("9"," $ACADVER");
	    write("1"," AC1009"); 
	    writer.println("SECTION");
	    writer.println("2");
	    writer.println("ENTITIES");*/
	    
	    writer.println("0");
	    writer.println("SECTION");
	    writer.println("2");
	    writer.println("ENTITIES");
	  }
  private void writeHeaderAll() {
    writer.println("0");
    write("2","HEADER");
    write("9"," $ACADVER");
    write("1"," AC1009"); 
    writer.println("SECTION");
    writer.println("2");
    writer.println("ENTITIES");
  }


  private void writeFooter() {
    writer.println("0");
    writer.println("ENDSEC");
    writer.println("0");
    writer.println("EOF");
  }


  /**
   * Write a command on one line (as a String), then start a new line
   * and write out a formatted float. Available for anyone who wants to
   * insert additional commands into the DXF stream.
   */
  public void write(String cmd, float val) {
    writer.println(cmd);
    // don't format, will cause trouble on systems that aren't en-us
    // http://dev.processing.org/bugs/show_bug.cgi?id=495
    writer.println(val);
  }
  /**
   * Write a command on one line (as a String), then start a new line
   * and write out a formatted float. Available for anyone who wants to
   * insert additional commands into the DXF stream.
   */
  public void write(String cmd, String val) {
    writer.println(cmd);
    // don't format, will cause trouble on systems that aren't en-us
    // http://dev.processing.org/bugs/show_bug.cgi?id=495
    writer.println(val);
  }

  /**
   * Write a line to the dxf file. Available for anyone who wants to
   * insert additional commands into the DXF stream.
   */
  public void println(String what) {
    writer.println(what);
  }


  protected void writeLine(int index1, int index2) {
    writer.println("0");
    writer.println("LINE");

    // write out the layer
    writer.println("8");
    writer.println(String.valueOf(currentLayer));
    // write out the color
    write("62",currentLayer+"");// color
   

    write("10", vertices[index1][X]);
    write("20", vertices[index1][Y]);
    write("30", vertices[index1][Z]);

    write("11", vertices[index2][X]);
    write("21", vertices[index2][Y]);
    write("31", vertices[index2][Z]);
  }


  /*
  protected void writeLineStrip() {
    writeLine();
    // shift the last vertex to be the first vertex
    System.arraycopy(vertices[1], 0, vertices[0], 0, vertices[1].length);
    vertexCount = 1;
  }
  */


  protected void writeTriangle() {
    writer.println("0");
    writer.println("3DFACE");

    // write out the layer
    writer.println("8");
    /*
    if (i < MAX_TRI_LAYERS) {
      if (layerList[i] >= 0) {
        currentLayer = layerList[i];
      }
    }
    */
    writer.println(String.valueOf(currentLayer));

    write("10", vertices[0][X]);
    write("20", vertices[0][Y]);
    write("30", vertices[0][Z]);

    write("11", vertices[1][X]);
    write("21", vertices[1][Y]);
    write("31", vertices[1][Z]);

    write("12", vertices[2][X]);
    write("22", vertices[2][Y]);
    write("32", vertices[2][Z]);

    // without adding EPSILON, rhino kinda freaks out
    // a face is actually a quad, not a triangle,
    // so instead kinda fudging the final point here.
    write("13", vertices[2][X] + EPSILON);
    write("23", vertices[2][Y] + EPSILON);
    write("33", vertices[2][Z] + EPSILON);

    vertexCount = 0;
  }


  // ..............................................................


  public void beginShape(int kind) {
    shape = kind;

    if ((shape != LINES) &&
        (shape != TRIANGLES) &&
        (shape != POLYGON)) {
      String err =
        "RawDXF can only be used with beginRaw(), " +
        "because it only supports lines and triangles";
      throw new RuntimeException(err);
    }

    if ((shape == POLYGON) && fill) {
      throw new RuntimeException("RawDXF only supports non-filled shapes.");
    }

    vertexCount = 0;
  }


  public void vertex(float x, float y) {
    vertex(x, y, 0);
  }

  public void writePolyLine(List<? extends HasPos2D>pts,boolean closed,float facY){
	  write("0","POLYLINE");
	  write("8",currentLayer);
	  write("62",currentLayer);// color
	  write("66","1");// entities follow;
	  write("10","0");
	  write("20","0");
	  write("30","0");
	  for (int i=0;i<pts.size();i++){
		  write("0","VERTEX");
		  write("8",currentLayer);
		  HasPos2D p=pts.get(i);
		  write("62","1");// color
		  write("10",""+p.getX());
		  write("20",""+p.getY()*facY);
		  write("30",""+0);
	  }
	  if (closed){
		  write("0","VERTEX");
		  write("8",currentLayer);
		  HasPos2D p=pts.get(0);
		  write("62","1");// color
		  write("10",""+p.getX());
		  write("20",""+p.getY()*facY);
		  write("30",""+0);
	  }
	 write("0","SEQEND");
	 write("8",currentLayer);
	 write("62","1");
  }

  public void vertex(float x, float y, float z) {
    float vertex[] = vertices[vertexCount];

    vertex[X] = x;  // note: not mx, my, mz like PGraphics3
    vertex[Y] = y;
    vertex[Z] = z;

    if (fill) {
      vertex[R] = fillR;
      vertex[G] = fillG;
      vertex[B] = fillB;
      vertex[A] = fillA;
    }

    if (stroke) {
      vertex[SR] = strokeR;
      vertex[SG] = strokeG;
      vertex[SB] = strokeB;
      vertex[SA] = strokeA;
      vertex[SW] = strokeWeight;
    }

    if (textureImage != null) {  // for the future?
      vertex[U] = textureU;
      vertex[V] = textureV;
    }
    vertexCount++;

    if ((shape == LINES) && (vertexCount == 2)) {
      writeLine(0, 1);
      vertexCount = 0;

/*
    } else if ((shape == LINE_STRIP) && (vertexCount == 2)) {
      writeLineStrip();
*/

    } else if ((shape == TRIANGLES) && (vertexCount == 3)) {
      writeTriangle();
    }
  }


  public void endShape(int mode) {
    if (shape == POLYGON) {
      for (int i = 0; i < vertexCount - 1; i++) {
        writeLine(i, i+1);
      }
      if (mode == CLOSE) {
        writeLine(vertexCount - 1, 0);
      }
    }
    /*
    if ((vertexCount != 0) &&
        ((shape != LINE_STRIP) && (vertexCount != 1))) {
      System.err.println("Extra vertex boogers found.");
    }
    */
  }
  public String[] getHeader(){
	 // return new String{""+0;""+SECTION;""+  2;""+HEADER;""+  9;""+$ACADVER;""+  1;""+AC1009;""+  9;""+$DWGCODEPAGE;""+  3;""+ansi_950;""+  9;""+$INSBASE;""+ 10;""+0.0;""+ 20;""+0.0;""+ 30;""+0.0;""+  9;""+$EXTMIN;""+ 10;""+-444.7337;""+ 20;""+-42.35552;""+ 30;""+0.0;""+  9;""+$EXTMAX;""+ 10;""+444.72766;""+ 20;""+851.9325;""+ 30;""+0.0;""+  9;""+$LIMMIN;""+ 10;""+0.0;""+ 20;""+0.0;""+  9;""+$LIMMAX;""+ 10;""+12.0;""+ 20;""+9.0;""+  9;""+$ORTHOMODE;""+ 70;""+     0;""+  9;""+$REGENMODE;""+ 70;""+     1;""+  9;""+$FILLMODE;""+ 70;""+     1;""+  9;""+$QTEXTMODE;""+ 70;""+     0;""+  9;""+$MIRRTEXT;""+ 70;""+     1;""+  9;""+$DRAGMODE;""+ 70;""+     2;""+  9;""+$LTSCALE;""+ 40;""+1.0;""+  9;""+$OSMODE;""+ 70;""+    37;""+  9;""+$ATTMODE;""+ 70;""+     1;""+  9;""+$TEXTSIZE;""+ 40;""+0.2;""+  9;""+$TRACEWID;""+ 40;""+0.05;""+  9;""+$TEXTSTYLE;""+  7;""+STANDARD;""+  9;""+$CLAYER;""+  8;""+0;""+  9;""+$CELTYPE;""+  6;""+BYLAYER;""+  9;""+$CECOLOR;""+ 62;""+   256;""+  9;""+$DIMSCALE;""+ 40;""+1.0;""+  9;""+$DIMASZ;""+ 40;""+0.18;""+  9;""+$DIMEXO;""+ 40;""+0.0625;""+  9;""+$DIMDLI;""+ 40;""+0.38;""+  9;""+$DIMRND;""+ 40;""+0.0;""+  9;""+$DIMDLE;""+ 40;""+0.0;""+  9;""+$DIMEXE;""+ 40;""+0.18;""+  9;""+$DIMTP;""+ 40;""+0.0;""+  9;""+$DIMTM;""+ 40;""+0.0;""+  9;""+$DIMTXT;""+ 40;""+0.18;""+  9;""+$DIMCEN;""+ 40;""+0.09;""+  9;""+$DIMTSZ;""+ 40;""+0.0;""+  9;""+$DIMTOL;""+ 70;""+     0;""+  9;""+$DIMLIM;""+ 70;""+     0;""+  9;""+$DIMTIH;""+ 70;""+     1;""+  9;""+$DIMTOH;""+ 70;""+     1;""+  9;""+$DIMSE1;""+ 70;""+     0;""+  9;""+$DIMSE2;""+ 70;""+     0;""+  9;""+$DIMTAD;""+ 70;""+     0;""+  9;""+$DIMZIN;""+ 70;""+     0;""+  9;""+$DIMBLK;""+  1;""+;""+  9;""+$DIMASO;""+ 70;""+     1;""+  9;""+$DIMSHO;""+ 70;""+     1;""+  9;""+$DIMPOST;""+  1;""+;""+  9;""+$DIMAPOST;""+  1;""+;""+  9;""+$DIMALT;""+ 70;""+     0;""+  9;""+$DIMALTD;""+ 70;""+     2;""+  9;""+$DIMALTF;""+ 40;""+25.4;""+  9;""+$DIMLFAC;""+ 40;""+1.0;""+  9;""+$DIMTOFL;""+ 70;""+     0;""+  9;""+$DIMTVP;""+ 40;""+0.0;""+  9;""+$DIMTIX;""+ 70;""+     0;""+  9;""+$DIMSOXD;""+ 70;""+     0;""+  9;""+$DIMSAH;""+ 70;""+     0;""+  9;""+$DIMBLK1;""+  1;""+;""+  9;""+$DIMBLK2;""+  1;""+;""+  9;""+$DIMSTYLE;""+  2;""+STANDARD;""+  9;""+$DIMCLRD;""+ 70;""+     0;""+  9;""+$DIMCLRE;""+ 70;""+     0;""+  9;""+$DIMCLRT;""+ 70;""+     0;""+  9;""+$DIMTFAC;""+ 40;""+1.0;""+  9;""+$DIMGAP;""+ 40;""+0.09;""+  9;""+$LUNITS;""+ 70;""+     2;""+  9;""+$LUPREC;""+ 70;""+     2;""+  9;""+$SKETCHINC;""+ 40;""+0.1;""+  9;""+$FILLETRAD;""+ 40;""+0.5;""+  9;""+$AUNITS;""+ 70;""+     0;""+  9;""+$AUPREC;""+ 70;""+     0;""+  9;""+$MENU;""+  1;""+.;""+  9;""+$ELEVATION;""+ 40;""+0.0;""+  9;""+$PELEVATION;""+ 40;""+0.0;""+  9;""+$THICKNESS;""+ 40;""+0.0;""+  9;""+$LIMCHECK;""+ 70;""+     0;""+  9;""+$CHAMFERA;""+ 40;""+0.5;""+  9;""+$CHAMFERB;""+ 40;""+0.5;""+  9;""+$SKPOLY;""+ 70;""+     0;""+  9;""+$TDCREATE;""+ 40;""+2456051.784093669;""+  9;""+$TDUPDATE;""+ 40;""+2456051.78409368;""+  9;""+$TDINDWG;""+ 40;""+0.0000000116;""+  9;""+$TDUSRTIMER;""+ 40;""+0.0000000116;""+  9;""+$USRTIMER;""+ 70;""+     1;""+  9;""+$ANGBASE;""+ 50;""+0.0;""+  9;""+$ANGDIR;""+ 70;""+     0;""+  9;""+$PDMODE;""+ 70;""+     0;""+  9;""+$PDSIZE;""+ 40;""+0.0;""+  9;""+$PLINEWID;""+ 40;""+0.0;""+  9;""+$COORDS;""+ 70;""+     1;""+  9;""+$SPLFRAME;""+ 70;""+     0;""+  9;""+$SPLINETYPE;""+ 70;""+     6;""+  9;""+$SPLINESEGS;""+ 70;""+     8;""+  9;""+$ATTDIA;""+ 70;""+     0;""+  9;""+$ATTREQ;""+ 70;""+     1;""+  9;""+$HANDLING;""+ 70;""+     1;""+  9;""+$HANDSEED;""+  5;""+CEE;""+  9;""+$SURFTAB1;""+ 70;""+     6;""+  9;""+$SURFTAB2;""+ 70;""+     6;""+  9;""+$SURFTYPE;""+ 70;""+     6;""+  9;""+$SURFU;""+ 70;""+     6;""+  9;""+$SURFV;""+ 70;""+     6;""+  9;""+$UCSNAME;""+  2;""+;""+  9;""+$UCSORG;""+ 10;""+0.0;""+ 20;""+0.0;""+ 30;""+0.0;""+  9;""+$UCSXDIR;""+ 10;""+1.0;""+ 20;""+0.0;""+ 30;""+0.0;""+  9;""+$UCSYDIR;""+ 10;""+0.0;""+ 20;""+1.0;""+ 30;""+0.0;""+  9;""+$PUCSNAME;""+  2;""+;""+  9;""+$PUCSORG;""+ 10;""+0.0;""+ 20;""+0.0;""+ 30;""+0.0;""+  9;""+$PUCSXDIR;""+ 10;""+1.0;""+ 20;""+0.0;""+ 30;""+0.0;""+  9;""+$PUCSYDIR;""+ 10;""+0.0;""+ 20;""+1.0;""+ 30;""+0.0;""+  9;""+$USERI1;""+ 70;""+     0;""+  9;""+$USERI2;""+ 70;""+     0;""+  9;""+$USERI3;""+ 70;""+     0;""+  9;""+$USERI4;""+ 70;""+     0;""+  9;""+$USERI5;""+ 70;""+     0;""+  9;""+$USERR1;""+ 40;""+0.0;""+  9;""+$USERR2;""+ 40;""+0.0;""+  9;""+$USERR3;""+ 40;""+0.0;""+  9;""+$USERR4;""+ 40;""+0.0;""+  9;""+$USERR5;""+ 40;""+0.0;""+  9;""+$WORLDVIEW;""+ 70;""+     1;""+  9;""+$SHADEDGE;""+ 70;""+     3;""+  9;""+$SHADEDIF;""+ 70;""+    70;""+  9;""+$TILEMODE;""+ 70;""+     1;""+  9;""+$MAXACTVP;""+ 70;""+    64;""+  9;""+$PLIMCHECK;""+ 70;""+     0;""+  9;""+$PEXTMIN;""+ 10;""+1.000000000000000E+20;""+ 20;""+1.000000000000000E+20;""+ 30;""+1.000000000000000E+20;""+  9;""+$PEXTMAX;""+ 10;""+-1.000000000000000E+20;""+ 20;""+-1.000000000000000E+20;""+ 30;""+-1.000000000000000E+20;""+  9;""+$PLIMMIN;""+ 10;""+0.0;""+ 20;""+0.0;""+  9;""+$PLIMMAX;""+ 10;""+12.0;""+ 20;""+9.0;""+  9;""+$UNITMODE;""+ 70;""+     0;""+  9;""+$VISRETAIN;""+ 70;""+     1;""+  9;""+$PLINEGEN;""+ 70;""+     0;""+  9;""+$PSLTSCALE;""+ 70;""+     1;""+  0;""+ENDSEC;""+  0;""+SECTION;""+  2;""+TABLES;""+  0;""+TABLE;""+  2;""+VPORT;""+ 70;""+     1;""+  0;""+VPORT;""+  2;""+*ACTIVE;""+ 70;""+     0;""+ 10;""+0.0;""+ 20;""+0.0;""+ 11;""+1.0;""+ 21;""+1.0;""+ 12;""+-0.0030199999999923;""+ 22;""+404.78849;""+ 13;""+0.0;""+ 23;""+0.0;""+ 14;""+0.5;""+ 24;""+0.5;""+ 15;""+0.5;""+ 25;""+0.5;""+ 16;""+0.0;""+ 26;""+0.0;""+ 36;""+1.0;""+ 17;""+0.0;""+ 27;""+0.0;""+ 37;""+0.0;""+ 40;""+912.1737803999999;""+ 41;""+0.9946027902733172;""+ 42;""+50.0;""+ 43;""+0.0;""+ 44;""+0.0;""+ 50;""+0.0;""+ 51;""+0.0;""+ 71;""+     0;""+ 72;""+   100;""+ 73;""+     1;""+ 74;""+     3;""+ 75;""+     0;""+ 76;""+     0;""+ 77;""+     0;""+ 78;""+     0;""+  0;""+ENDTAB;""+  0;""+TABLE;""+  2;""+LTYPE;""+ 70;""+     1;""+  0;""+LTYPE;""+  2;""+CONTINUOUS;""+ 70;""+     0;""+  3;""+Solid line;""+ 72;""+    65;""+ 73;""+     0;""+ 40;""+0.0;""+  0;""+ENDTAB;""+  0;""+TABLE;""+  2;""+LAYER;""+ 70;""+     3;""+  0;""+LAYER;""+  2;""+0;""+ 70;""+     0;""+ 62;""+     7;""+  6;""+CONTINUOUS;""+  0;""+LAYER;""+  2;""+OUTLINE;""+ 70;""+     0;""+ 62;""+     1;""+  6;""+CONTINUOUS;""+  0;""+LAYER;""+  2;""+LABEL;""+ 70;""+     0;""+ 62;""+     5;""+  6;""+CONTINUOUS;""+  0;""+ENDTAB;""+  0;""+TABLE;""+  2;""+STYLE;""+ 70;""+     1;""+  0;""+STYLE;""+  2;""+STANDARD;""+ 70;""+     0;""+ 40;""+0.0;""+ 41;""+1.0;""+ 50;""+0.0;""+ 71;""+     0;""+ 42;""+0.2;""+  3;""+txt;""+  4;""+;""+  0;""+ENDTAB;""+  0;""+TABLE;""+  2;""+VIEW;""+ 70;""+     0;""+  0;""+ENDTAB;""+  0;""+TABLE;""+  2;""+UCS;""+ 70;""+     0;""+  0;""+ENDTAB;""+  0;""+TABLE;""+  2;""+APPID;""+ 70;""+     1;""+  0;""+APPID;""+  2;""+ACAD;""+ 70;""+     0;""+  0;""+ENDTAB;""+  0;""+TABLE;""+  2;""+DIMSTYLE;""+ 70;""+     1;""+  0;""+DIMSTYLE;""+  2;""+STANDARD;""+ 70;""+     0;""+  3;""+;""+  4;""+;""+  5;""+;""+  6;""+;""+  7;""+;""+ 40;""+1.0;""+ 41;""+0.18;""+ 42;""+0.0625;""+ 43;""+0.38;""+ 44;""+0.18;""+ 45;""+0.0;""+ 46;""+0.0;""+ 47;""+0.0;""+ 48;""+0.0;""+140;""+0.18;""+141;""+0.09;""+142;""+0.0;""+143;""+25.4;""+144;""+1.0;""+145;""+0.0;""+146;""+1.0;""+147;""+0.09;""+ 71;""+     0;""+ 72;""+     0;""+ 73;""+     1;""+ 74;""+     1;""+ 75;""+     0;""+ 76;""+     0;""+ 77;""+     0;""+ 78;""+     0;""+170;""+     0;""+171;""+     2;""+172;""+     0;""+173;""+     0;""+174;""+     0;""+175;""+     0;""+176;""+     0;""+177;""+     0;""+178;""+     0;""+  0;""+ENDTAB;""+  0;""+ENDSEC;""+  0;""+SECTION;""+  2;""+BLOCKS;""+  0;""+BLOCK;""+  8;""+0;""+  2;""+$MODEL_SPACE;""+ 70;""+     0;""+ 10;""+0.0;""+ 20;""+0.0;""+ 30;""+0.0;""+  3;""+$MODEL_SPACE;""+  1;""+;""+  0;""+ENDBLK;""+  5;""+21;""+  8;""+0;""+  0;""+BLOCK;""+ 67;""+     1;""+  8;""+0;""+  2;""+$PAPER_SPACE;""+ 70;""+     0;""+ 10;""+0.0;""+ 20;""+0.0;""+ 30;""+0.0;""+  3;""+$PAPER_SPACE;""+  1;""+;""+  0;""+ENDBLK;""+  5;""+1D;""+ 67;""+     1;""+  8;""+0;""+  0;""+ENDSEC;""+  0;""+SECTION;""+  2;""+ENTITIES}; 
return null;
  }
}

